using System;
using Fornax020.SerialComm.Core;
using Fornax020.SerialComm.Protocol;

namespace Fornax020.SerialComm.Commands
{
    /// <summary>
    /// 开始曝光命令
    /// </summary>
    public class StartExposureCommand : CommandBase
    {
        public StartExposureCommand()
        {
            Name = "StartExposure";
            Description = "开始X射线曝光";
        }

        public override byte[] GetCommandData()
        {
            // 根据协议生成开始曝光命令
            // 格式: STX + 'E' + 'N' + '1' + CR
            byte[] command = new byte[5];
            command[0] = (byte)ProtocolConstants.STX;  // 起始字节
            command[1] = (byte)'E';  // EN命令
            command[2] = (byte)'N';  // EN命令
            command[3] = (byte)'1';  // 开始曝光
            command[4] = (byte)ProtocolConstants.CR;   // 结束字节
            
            return command;
        }
    }
}
